package com.seleniti.enpareja.controller.ui.view;

import java.util.List;
import java.util.Set;

import org.ioc.commons.flowcontrol.actioncontroller.IsExternalAction;
import org.ioc.commons.flowcontrol.eventbus.IsEvent;
import org.ioc.commons.flowcontrol.operationmanager.IsOperation;
import org.ioc.commons.ui.HasEnabled;
import org.ioc.commons.ui.HasLoader;
import org.ioc.commons.ui.HasText;
import org.ioc.commons.ui.HasValue;
import org.ioc.commons.ui.IsView;
import org.ioc.commons.ui.IsViewPresenter;

import com.seleniti.enpareja.controller.model.integration.database.domain.Product;
import com.seleniti.enpareja.controller.model.integration.database.domain.Store;

public interface PendingShoppingView extends EnParejaView<PendingShoppingView.Event, PendingShoppingView.Operation, PendingShoppingView.Action>, HasLoader, HasEnabled {
	
	@interface Fires {
		PendingShoppingView.Event[] value();
	}

	@interface Invokes {
		PendingShoppingView.Action[] value();
	}

	@interface Performs {
		PendingShoppingView.Operation[] value();
	}

	public enum Event implements IsEvent {
	}

	public enum Operation implements IsOperation {
		GettingData, Saving
	}

	public enum Action implements IsExternalAction {
	}

	public interface Presenter extends IsViewPresenter {

		void onSwitchElementFromList(Product value);

		void onAddNewElement();

		void onActionModeChanged();

		void onSelectionChanged();

		void onModifyElement(Product element);

		void onBoughtOrPendingButtonToggled();

		void onAddAndSetNewStore(Product element);

		void onStoreChanged(Product element, String storeId);

		void onWhereFilterChanged();
	}
	
	public enum ActionMode {
		SWITCH_LIST, DELETE_ELEMENT, MODIFY_ELEMENT;
	}

	void setActionMode(ActionMode mode);
	
	void addNewElement();

	ActionMode getActionMode();

	Set<Product> getSelection();

	void switchElementFromList(Product element);	
	
	void modifyElement(Product element);

	HasValue<Boolean> onlyPendingFilter();

	List<Product> productsList();

	void showWhereFilter();

	void hideWhereFilter();

	Store getWhereFilter();

	HasText whereFilterText();

	List<Store> storeList();

	HasValue<Integer> pendingCounter();

}

